package com.shqcjd.yunweiyanoperator.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shqcjd.yunweiyanoperator.R;
import com.shqcjd.yunweiyanoperator.model.pojo.StaffManageBean;

import java.util.List;

public class StaffReviewAdapter extends BaseQuickAdapter<StaffManageBean.ListBean, StaffReviewAdapter.ViewHolder> {
    private Context context;

    public StaffReviewAdapter(@Nullable List<StaffManageBean.ListBean> data, Context context) {
        super(R.layout.item_staff_manage, data);
        this.context = context;
    }

    @Override
    protected void convert(ViewHolder helper, StaffManageBean.ListBean item) {
        helper.tv_staff_manage_phone.setText(item.phoneNumber);
        helper.tv_staff_manage_name.setText(item.userName);
        helper.tv_staff_manage_tag.setText(item.userName.substring(0, 1));
        switch (item.review){
            case 0:
                helper.tv_staff_manage_type.setText("未审核");
                break;
            case 1:
                helper.tv_staff_manage_type.setText("已审核");
                break;
            case 2:
                helper.tv_staff_manage_type.setText("审核拒绝");
                break;
        }
    }

    class ViewHolder extends BaseViewHolder {
        TextView tv_staff_manage_type, tv_staff_manage_phone, tv_staff_manage_name, tv_staff_manage_tag;
        public ViewHolder(View view) {
            super(view);
            tv_staff_manage_type = view.findViewById(R.id.tv_staff_manage_type);
            tv_staff_manage_phone = view.findViewById(R.id.tv_staff_manage_phone);
            tv_staff_manage_name = view.findViewById(R.id.tv_staff_manage_name);
            tv_staff_manage_tag = view.findViewById(R.id.tv_staff_manage_tag);
        }
    }
}
